<template>
	<div>
		<h4>{{details.title}}</h4>
		<div class="day-cont">
			<span>发表时间 :<span>{{details.add_time | times('YYYY-MM-DD HH-mm-ss')}}</span></span>
			<span>点击 :<span>{{details.click}}</span>次</span>
		</div>
		<hr />
		<div class="thumbs">
			<vue-preview :slides="list_cont"></vue-preview>
		</div>
		<div>
			<div class="cont-img" v-html="details.content"></div>
		</div>
		<cont :uId = 'id'></cont>
	</div>
</template>

<script>	
import assem from '../assembly/assem.vue'
	export default {
		data(){
			return {
				 id:this.$route.params.id,
				 list_cont: [],
				 details:{}
			}
		},
		created(){
			this.getCont()
			this.getMin();
		},
		methods: {
			getMin (){
				this.$http.get('api/getthumimages/'+this.id).then((resolve) => {
					if (resolve.body.status == 0) {
						this.list_cont = resolve.body.message
						
						resolve.body.message.forEach(item => {
							item.w = 600,
							item.h = 400,
							item.msrc = item.src
						})
						this.list_cont = resolve.body.message
					} else{
						
					}
				},(reject) => {
					
				})
			},
			getCont (){
				this.$http.get('api/getimageInfo/'+this.id).then((resolve) => {
					if (resolve.body.status == 0) {
						this.details = resolve.body.message[0]
						
					} else{
						
					}
				},(reject) => {
					
				})
			},
		
		},
		components:{
			'cont':assem
		}
	}
</script>

<style lang="less" scoped>
			h4{
				color: aquamarine;
				padding: 10px 20px;
			}
			.day-cont{
				padding: 0 10px;
				font-size: 12px;
				display: flex;
				justify-content: space-between;
			}
			.cont-img{
				font-size: 13px;
				padding: 10px 10px;
			}
</style>
